using Boo.Lang;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEngine;
using UnityScript.Lang;

[Serializable]
public class fireworks : MonoBehaviour
{
	[Serializable]
	[CompilerGenerated]
	internal sealed class _0024changestate_0024376 : GenericGenerator<WaitForSeconds>
	{
		internal fireworks _0024self__0024378;

		public _0024changestate_0024376(fireworks self_)
		{
			_0024self__0024378 = self_;
		}

		public override IEnumerator<WaitForSeconds> GetEnumerator()
		{
			return new _0024(_0024self__0024378);
		}
	}

	public GameObject firework;

	public AudioClip[] sounds;

	public int state;

	public Transform cam;

	public fireworks()
	{
		state = 1;
	}

	public void Start()
	{
		StartCoroutine(changestate());
	}

	public void Update()
	{
		if (state == 1)
		{
			AudioSource.PlayClipAtPoint(sounds[UnityEngine.Random.Range(0, Extensions.get_length((System.Array)sounds))], cam.position);
			UnityEngine.Object.Instantiate(firework);
			state = 0;
			StartCoroutine(changestate());
		}
	}

	public IEnumerator changestate()
	{
		return new _0024changestate_0024376(this).GetEnumerator();
	}

	public void Main()
	{
	}
}
